import random

while 1:
    # 摇骰子
    a = random.randint(1, 6)
    b = random.randint(1, 6)
    c = random.randint(1, 6)
    m = a + b + c
    n = input("输入1开始，输入exit退出：")
    t = 100
    # 确认开始且金币大于等于100
    if n == "1" and t >=100:
        z = input("猜大小：")
        if (z == "大" and m >= 11) or (z == "小" and m < 11):
            print("恭喜猜对了")
            t += 100
        elif (z == "小" and m >= 11) or (z == "大" and m < 11):
            print("猜错了")
            t -= 100
        else:
            print("输入不合法")
    # 自愿退出或者金币小于100强迫退出
    elif n == "exit" or t < 100:
        print("退出游戏")
        break
    else:
        print("输入不合法")
